home *** CD-ROM | disk | FTP | other *** search
- 'Array to hold parts forms
- Const MAX_PARTS = 3
- Global PartsFormItems(MAX_PARTS) As FormItem
- Global PartsForms(MAX_PARTS) As PartsForm
-
- ' Array describing parts schema
-
- Global PartsSchema() As TABLESCHEMA
-
- Sub InitParts ()
- FormInit PartsFormItems()
-
- ' Initialize the schema for the parts database
-
- ReDim PartsSchema(3)
-
- PartsSchema(1).tsName = "PartNo"
- PartsSchema(1).tsType = DB_LONG
-
- PartsSchema(2).tsName = "Description"
- PartsSchema(2).tsType = DB_TEXT
- PartsSchema(2).tsSize = 80
-
- PartsSchema(3).tsName = "Price"
- PartsSchema(3).tsType = DB_CURRENCY
-
- End Sub
-
- Sub PartsOpen (fname As String, tbname As String)
- If Not FormAvail(PartsFormItems()) Then
- MsgBox "Cannot open more parts forms"
- Exit Sub
- End If
-
- i% = FormAlloc(PartsFormItems())
- PartsFormItems(i%).fiFileName = fname
- PartsFormItems(i%).fiTable = tbname
-
- Set PartsForms(i%) = New PartsForm
- PartsForms(i%).Show
- PartsForms(i%).Caption = "[" + ExtractBase(fname) + "]" + TnameDisp(tbname)
- End Sub
-
-